<%--
 *  File:    ProdEditMain.jsp
 *  @Author: Langerwang
 *  Date:    2001/01/14
 *  @Modifier: Jamesli
 *  Date:    2010/07/06
 *
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  Category cat = Category.getInstance("jsp.ProdEditMain");
  String privilegeCode = "10203,L203";
  String strModuleName = "PCM";
  String contextPath = request.getContextPath();
%>

<%
  String strIsNew=(String)request.getParameter("isnew");
  if(strIsNew==null)
    strIsNew="";
%>
<%
  HashMap userInfo = (HashMap)session.getAttribute("userinfo");

%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>

<html>
<head>
<title>ProdEditMain</title>
<PageFlow:CheckPageFlow pageName="prodeditmain"/>
<%@ include file="/inc/InitEdit.inc" %>
<%
  Integer nOldProdLineID = null;
  if ((HashMap)pageContext.getAttribute("productinfo") != null)
  {
    nOldProdLineID = (Integer)(((HashMap)pageContext.getAttribute("productinfo")).get("prodlineid"));
  }  
%>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<script language="JavaScript" src="../../js/ScriptLib.js"></script>
<iframe name="reloadHandler" style="display:none" ></iframe>
<script language="JavaScript">

function page_back()
{
  parent.up.page_goback();
}

</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table border=0 cellpadding=0 cellspacing=0 width="100%">
  <tr>
    <td valign=top>
      <table border=0 cellpadding=1 cellspacing=0 width="100%">
       <tbody>
       <form name="prodeditmainform" method="post" action="../../Dispatcher">
      <input type="hidden" name="pagename" value="prodeditmain">
      <input type="hidden" name="actionname">
      <input type="hidden" name="schema" value="">
      <input type="hidden" name="qlname" value="">
       <custom:hidden name="productinfo" property="prodid"/>
       <%
        String strorgid="";
        if(request.getParameter("orgid")!=null)
        {
            strorgid=(String)request.getParameter("orgid");
        }
        String strownerid="-1";
        if(request.getParameter("ownerid")!=null)
        {
            strownerid=(String)request.getParameter("ownerid");
        }
       %>
       <custom:hidden name="productinfo" property="orgid" value="<%=strorgid %>"/>
       <custom:hidden name="productinfo" property="languagecode" value="<%= strLanguageCode %>"/>
       <input type="hidden" name="datelastupdated" value="<%=JspHelper.filterNull( new java.sql.Date(new java.util.Date().getTime()) )%>"/>
       <custom:hidden name="productinfo" property="revision"/>
       <custom:hidden name="productinfo" property="status" value="10"/>
       <custom:hidden name="productinfo" property="productlangid"/>
      <input type="hidden" name="numrows" value="2">
      <input type="hidden" name="forremvoe" value=" ">
      <input type="hidden" name="copyprodlinedesc" value="N">
      <custom:hidden property="ownerid" value="<%=strownerid%>"/>
      <custom:hidden property="categoryorgid"/>
      <custom:hidden property="categoryidforgoto"/>
      <custom:hidden property="selectopt"/>
      <custom:hidden property="orderbycolumn"/>
      <custom:hidden property="orderbytype"/>
      <custom:hidden property="jumppage"/>
      <custom:hidden property="searchname"/>
      <custom:hidden property="searchvalue"/>

      <%if(strIsNew.equals("Y")){
      System.out.println("here new");%>
      <input type="hidden" name="isnew" value="Y"/>
	   <input type="hidden" name="sourceorgid" value="<%=JspHelper.filterNull( strorgid)%>">
	   <custom:hidden name="productinfo" property="prodcode"  changedName="itemcode"/>
	   <custom:hidden name="productinfo" property="unitprice"  changedName="listprice"/>
	   <input type="hidden" name="isbom" value="N">
	   <input type="hidden" name="ispublic" value="N">
      <%}%>
        <tr>
          <td bgcolor=#000000 style="PADDING-BOTTOM: 1px; PADDING-LEFT: 1px; PADDING-RIGHT: 1px; PADDING-TOP: 0px">
            <table bgcolor=#000000 border=0 cellpadding=0 cellspacing=0 width="100%">
              <tr>
                <td  bgcolor=#ffffff style="PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; PADDING-TOP: 3px">
                  <div id=div1 style="HEIGHT: 450px; OVERFLOW: auto">

        <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="0">
          <tr>
            <td colspan="4" class="deepblue-left"> <img src="../../images/<%= strLanguageCode %>/quote.gif">
              <%= label.getLabelName("L_BasicInfo") + label.getLabelName("L_Colon") %> </td>
          </tr>
          <%
            String strNeedClass="td-text";
            String strReadOnly="readonly";
            String strIsNull="Y";
            if(strIsNew.equals("Y"))
            {
              strNeedClass="need";
              strReadOnly="";
              strIsNull="N";
            }
          %>
          <tr>
            <td class="<%=JspHelper.filterNull(strNeedClass)%>" width="120"><%= label.getLabelName("L_ProdCode") + label.getLabelName("L_Colon") %></td>
            <td  >
            	<custom:write property="prodcode" name="productinfo" nbsp="true"/>
            </td>
            <td class="td-text" width="106" ><%= label.getLabelName("L_Category") + label.getLabelName("L_Colon") %></td>
            <td>
			    <custom:write name="productinfo" property="categorycode" nbsp="true"/>
                <custom:write name="productinfo" property="categoryname" nbsp="true"/>
            </td>
          </tr>
          <tr>
            <td class="td-text"><%= label.getLabelName("L_ProductName") + label.getLabelName("L_Colon") %></td>
            <td>
            	<custom:write name="productinfo" property="prodname" nbsp="true"/>
            </td>
            <td class="td-text"><%= label.getLabelName("L_Spec") + label.getLabelName("L_Colon") %></td>
            <td>
            	<custom:write name="productinfo" property="spec" nbsp="true"/>
            </td>
          </tr>
          <tr>
            <td class="td-text" ><%= label.getLabelName("L_OriginalCountry") + label.getLabelName("L_Colon") %></td>
            <td >
            	<custom:write name="productinfo" property="originalcountry" nbsp="true"/>
            </td>
            <td class="td-text"><%= label.getLabelName("L_Manufacturer") + label.getLabelName("L_Colon") %></td>
            <td  >
            	<custom:write name="productinfo" property="manufacturer" nbsp="true"/>
            </td>
          </tr>
          <tr>
            <td class="td-text"><%= label.getLabelName("L_Brand") + label.getLabelName("L_Colon") %></td>
            <td >
            	<custom:write name="productinfo" property="brandname" nbsp="true"/>
            </td>
            <td class="td-text"><%= label.getLabelName("L_MaterialType") + label.getLabelName("L_Colon") %></td>
            <td >
            	<custom:write name="productinfo" property="materialtypename" nbsp="true"/>
            </td>
          </tr>
          
          <tr>
            <td class="td-text"><%= label.getLabelName("L_UOM") + label.getLabelName("L_Colon") %></td>
            <td >
            	<custom:write name="productinfo" property="umname" nbsp="true"/>
            </td>
            <td class="td-text" width="106"><%= label.getLabelName("L_Price") + label.getLabelName("L_Colon") %></td>
            <td >
            	<custom:write name="productinfo" property="unitprice" nbsp="true"/>
            </td>
          </tr>
        </table>
       </div>
      </td>
    </tr>
   </table>
  </td>
 </tr>
</form>
 </tbody>
</table>
</td>
</tr>
<tr>
  <td class="summary_top"></td>
</tr>
<tr>
  <td class="td_center">
    <a onclick="page_back()"><custom:button type="1" label="L_Back" imgsrc="back.gif" border="0" style="width:60"/></a>
  </td>
</tr>
</table>
</body>
</html>